home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / sed / sed113st.zoo / configure < prev    next >
Encoding:
Text File  |  1992-10-16  |  9.8 KB  |  384 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec_prefix=PREFIX] [--with-PROGRAM] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec_prefix, and --no-create.
  23.  
  24. trap 'rm -f conftest* core; exit 1' 1 3 15
  25.  
  26. for arg
  27. do
  28.   # Handle --exec_prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  52.         no_create=1 ;;
  53.  
  54.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  55.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  56.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  57.     next_prefix=yes ;;
  58.  
  59.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  60.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  61.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  62.     next_srcdir=yes ;;
  63.  
  64.      -with-* | --with-*) ;;
  65.  
  66.      *) ;;
  67.     esac
  68.   fi
  69. done
  70.  
  71. rm -f conftest*
  72. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  73.  
  74. # A filename unique to this package, relative to the directory that
  75. # configure is in, which we can look for to find out if srcdir is correct.
  76. unique_file=sed.c
  77.  
  78. # Find the source files, if location was not specified.
  79. if test -z "$srcdir"; then
  80.   srcdirdefaulted=yes
  81.   # Try the directory containing this script, then `..'.
  82.   prog=$0
  83.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  84.   test "X$confdir" = "X$prog" && confdir=.
  85.   srcdir=$confdir
  86.   if test ! -r $srcdir/$unique_file; then
  87.     srcdir=..
  88.   fi
  89. fi
  90. if test ! -r $srcdir/$unique_file; then
  91.   if test x$srcdirdefaulted = xyes; then
  92.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  93.   else
  94.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  95.   fi
  96.   exit 1
  97. fi
  98. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  99. # But we can't avoid them for `..', to make subdirectories work.
  100. case $srcdir in
  101.   .|/*|~*) ;;
  102.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  103. esac
  104.  
  105. if test -z "$CC"; then
  106.   echo checking for gcc
  107.   saveifs="$IFS"; IFS="${IFS}:"
  108.   for dir in $PATH; do
  109.     test -z "$dir" && dir=.
  110.     if test -f $dir/gcc; then
  111.       CC="gcc"
  112.       break
  113.     fi
  114.   done
  115.   IFS="$saveifs"
  116. fi
  117. test -z "$CC" && CC="cc"
  118.  
  119. # Find out if we are using GNU C, under whatever name.
  120. cat <<EOF > conftest.c
  121. #ifdef __GNUC__
  122.   yes
  123. #endif
  124. EOF
  125. ${CC-cc} -E conftest.c > conftest.out 2>&1
  126. if egrep yes conftest.out >/dev/null 2>&1; then
  127.   GCC=1 # For later tests.
  128.   CC="$CC -O"
  129. fi
  130. rm -f conftest*
  131.  
  132. echo checking how to run the C preprocessor
  133. if test -z "$CPP"; then
  134.   CPP='${CC-cc} -E'
  135.   cat <<EOF > conftest.c
  136.  
  137. #include <stdio.h>
  138. EOF
  139. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  140. if test -z "$err"; then
  141.   :
  142. else
  143.   CPP=/lib/cpp
  144. fi
  145. rm -f conftest*
  146. fi
  147.  
  148. # Make sure to not get the incompatible SysV /etc/install and
  149. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  150. # or the SunOS /usr/etc/install directory.
  151. if test -z "$INSTALL"; then
  152.   echo checking for install
  153.   saveifs="$IFS"; IFS="${IFS}:"
  154.   for dir in $PATH; do
  155.     test -z "$dir" && dir=.
  156.     case $dir in
  157.     /etc|/usr/sbin|/usr/etc) ;;
  158.     *)
  159.       if test -f $dir/install; then
  160.     INSTALL="$dir/install -c"
  161.     INSTALL_PROGRAM='$(INSTALL)'
  162.     INSTALL_DATA='$(INSTALL) -m 644'
  163.     break
  164.       fi
  165.       ;;
  166.     esac
  167.   done
  168.   IFS="$saveifs"
  169. fi
  170. INSTALL=${INSTALL-cp}
  171. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  172. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  173.  
  174. echo checking for minix/config.h
  175. cat <<EOF > conftest.c
  176.  
  177. #include <minix/config.h>
  178. EOF
  179. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  180. if test -z "$err"; then
  181.   MINIX=1
  182. fi
  183. rm -f conftest*
  184.  
  185. # The Minix shell can't assign to the same variable on the same line!
  186. if test -n "$MINIX"; then
  187.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  188.   DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  189.   DEFS="$DEFS -D_MINIX=1"
  190. fi
  191.  
  192. echo checking for POSIXized ISC
  193. if test -d /etc/conf/kconfig.d &&
  194.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  195. then
  196.   ISC=1 # If later tests want to check for ISC.
  197.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  198.   if test -n "$GCC"; then
  199.     CC="$CC -posix"
  200.   else
  201.     CC="$CC -Xp"
  202.   fi
  203. fi
  204.  
  205. echo checking for ANSI C header files
  206. cat <<EOF > conftest.c
  207.  
  208. #include <stdlib.h>
  209. #include <stdarg.h>
  210. #include <string.h>
  211. #include <float.h>
  212. #include <limits.h>
  213. EOF
  214. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  215. if test -z "$err"; then
  216.   DEFS="$DEFS -DSTDC_HEADERS=1"
  217. fi
  218. rm -f conftest*
  219.  
  220. echo checking for BSD string and memory functions
  221. echo "#include <strings.h>
  222. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  223. if eval $compile; then
  224.   :
  225. else
  226.   DEFS="$DEFS -DUSG=1"
  227. fi
  228. rm -f conftest*
  229.  
  230. echo checking for vprintf
  231. echo "
  232. main() { exit(0); } t() { vprintf(); }" > conftest.c
  233. if eval $compile; then
  234.   DEFS="$DEFS -DHAVE_VPRINTF=1"
  235. else
  236.   vprintf_missing=1
  237. fi
  238. rm -f conftest*
  239.  
  240. if test -n "$vprintf_missing"; then
  241. echo checking for _doprnt
  242. echo "
  243. main() { exit(0); } t() { _doprnt(); }" > conftest.c
  244. if eval $compile; then
  245.   DEFS="$DEFS -DHAVE_DOPRNT=1"
  246. fi
  247. rm -f conftest*
  248.  
  249. fi
  250.  
  251. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  252. # for constant arguments.  Useless!
  253. echo checking for working alloca.h
  254. echo "#include <alloca.h>
  255. main() { exit(0); } t() { char *p = alloca(2 * sizeof(int)); }" > conftest.c
  256. if eval $compile; then
  257.   DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  258. fi
  259. rm -f conftest*
  260.  
  261. decl="#ifdef __GNUC__
  262. #define alloca __builtin_alloca
  263. #else
  264. #if HAVE_ALLOCA_H
  265. #include <alloca.h>
  266. #else
  267. #ifdef _AIX
  268.  #pragma alloca
  269. #else
  270. char *alloca ();
  271. #endif
  272. #endif
  273. #endif
  274. "
  275. echo checking for alloca
  276. echo "$decl
  277. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  278. if eval $compile; then
  279.   :
  280. else
  281.   alloca_missing=1
  282. fi
  283. rm -f conftest*
  284.  
  285. if test -n "$alloca_missing"; then
  286.   SAVELIBS="$LIBS"
  287.   # Maybe alloca is in a different library.
  288.   #if test -f /usr/ucblib/libucb.a; then
  289.     # Avoid the broken BSD compatibility library as much as possible.
  290.     #LIBS="$LIBS -L/usr/ucblib -lc -lucb" trylib=-lucb # SVR4
  291.   #el
  292.   if test -f /lib/libPW.a; then
  293.     LIBS="$LIBS -lPW" trylib=-lPW # SVR2 and SVR3
  294.   fi
  295.   if test -n "$trylib"; then
  296.     alloca_missing=
  297.     echo checking for alloca in $trylib
  298. echo "$decl
  299. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  300. if eval $compile; then
  301.   :
  302. else
  303.   alloca_missing=1
  304. fi
  305. rm -f conftest*
  306.  
  307.   fi
  308.   if test -n "$alloca_missing"; then
  309.     LIBS="$SAVELIBS" ALLOCA=alloca.o
  310.   fi
  311. fi
  312.  
  313. if test -n "$prefix"; then
  314.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  315.   prsub="s%^prefix[     ]*=.*$%prefix = $prefix%"
  316. fi
  317. if test -n "$exec_prefix"; then
  318.   prsub="$prsub
  319. s%^exec_prefix[     ]*=.*$%exec_prefix = $exec_prefix%"
  320. fi
  321.  
  322. trap 'rm -f config.status; exit 1' 1 3 15
  323. echo creating config.status
  324. rm -f config.status
  325. cat <<EOF > config.status
  326. #!/bin/sh
  327. # Generated automatically by configure.
  328. # Run this file to recreate the current configuration.
  329. # This directory was configured as follows,
  330. # on host `(hostname || uname -n) 2>/dev/null`:
  331. #
  332. # $0 $*
  333.  
  334. case "\$1" in
  335.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  336.   exec /bin/sh $0 $* ;;
  337. esac
  338.  
  339. trap 'rm -f Makefile; exit 1' 1 3 15
  340. CC='$CC'
  341. CPP='$CPP'
  342. INSTALL='$INSTALL'
  343. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  344. INSTALL_DATA='$INSTALL_DATA'
  345. ALLOCA='$ALLOCA'
  346. LIBS='$LIBS'
  347. srcdir='$srcdir'
  348. DEFS='$DEFS'
  349. prefix='$prefix'
  350. exec_prefix='$exec_prefix'
  351. prsub='$prsub'
  352. EOF
  353. cat <<\EOF >> config.status
  354.  
  355. top_srcdir=$srcdir
  356. for file in Makefile; do
  357.   srcdir=$top_srcdir
  358.   # Remove last slash and all that follows it.  Not all systems have dirname.
  359.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  360.   if test "$dir" != "$file"; then
  361.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  362.     test ! -d $dir && mkdir $dir
  363.   fi
  364.   echo creating $file
  365.   rm -f $file
  366.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  367.   sed -e "
  368. $prsub
  369. s%@CC@%$CC%g
  370. s%@CPP@%$CPP%g
  371. s%@INSTALL@%$INSTALL%g
  372. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  373. s%@INSTALL_DATA@%$INSTALL_DATA%g
  374. s%@ALLOCA@%$ALLOCA%g
  375. s%@LIBS@%$LIBS%g
  376. s%@srcdir@%$srcdir%g
  377. s%@DEFS@%$DEFS%" $top_srcdir/${file}.in >> $file
  378. done
  379.  
  380. EOF
  381. chmod +x config.status
  382. test -n "$no_create" || ./config.status
  383.  
  384.